{extend name="base" /}
<!-- page specific plugin styles -->
{block name="plugin-styles"}
    <link rel="stylesheet" href="/static/ace/assets/css/colorbox.min.css" />
{/block}
<!-- inline styles related to this page -->
{block name="inline-styles"}{/block}
<!-- breadcrumb -->
{block name="breadcrumbs"}
<ul class="breadcrumb">
    <li>
        <i class="ace-icon fa fa-home home-icon"></i>
        <a href="{:url('Index/index')}">首页</a>
    </li>
    <li class="active">分类更新</li>
</ul>
<!-- /.breadcrumb -->
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page-header">
    <h1>
        分类更新
    </h1>
</div>
<!-- /.page-header -->
<form class="form-horizontal" id="ajaxForm">
    <div class="form-group">
        <input type="hidden" name="id" value='{$cate.id}'/> 
        <label class="col-sm-2 control-label no-padding-right"> 分类名称 </label>
        <div class="col-sm-9">
            <input type="text" name="catname" placeholder="" id="catname" value='{$cate.catname}'>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"> 是否上架 </label>
        <div class="col-sm-9">
            <label class="radio-inline">
                <input type="radio" name="isshow" value="1" {eq name = '$cate.isshow' value='1' }checked=""{/eq}> 是
            </label>
            <label class="radio-inline">
                <input type="radio" name="isshow" value="2" {eq name = '$cate.isshow' value='2' }checked=""{/eq}> 否
            </label>
        </div>
    </div>
    <div class="clearfix form-actions">
        <div class="col-md-offset-3 col-md-9">
            <button class="btn btn-info" type="button" id="showToast">
                <i class="ace-icon fa fa-check bigger-110"></i>
                更新
            </button>
        </div>
    </div>
    </form>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- page specific plugin scripts -->
{block name="plugin-scripts"}
<script src="/static/ace/assets/js/jquery.dataTables.min.js"></script>
<script src="/static/ace/assets/js/jquery.dataTables.bootstrap.min.js"></script>
<script src="/static/ace/assets/js/jquery.colorbox.min.js"></script>
{/block}
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
$("#showToast").click(function(event) {
    /* Act on the event */
    var options={
        url:"/admin/goods_classify/edit_post",
        type:"POST",
        dataType:"json",
        success: function(json){

            if(json.returnCode==1){
                alert('更新成功');
                window.location=document.referrer;
            }else{
                alert(json.returnMsg);
            }
        }
    };
    $("#ajaxForm").ajaxSubmit(options)
});
</script>
{/block}